<template>
  <div class="approve">
    <div class="initial-info-box">
      <div class="initial-name-box">
        <header>开始</header>
        <section>
          <span>添加审批</span>
          <span @click="addExamine(1)" v-show="list.length == 0"
            ><a-icon type="plus-circle"
          /></span>
        </section>
      </div>

      <div class="line-box" v-show="list.length > 0">
        <div class="line"></div>
        <!-- <div class="line-img" >
          <img src="@/assets/img/Icon/添加-填充-蓝.png" alt="" />
        </div> -->
      </div>
    </div>
    <div class="info-box" v-for="(item, index) in list" :key="index">
      <div class="name-box">
        <div
          class="name-list-box"
          v-for="(itm, idx) in RelationList"
          :key="idx"
        >
          <div class="box">
            <header>审批人</header>
            <section>
              <span>{{ itm.userName || "空" }}</span>
              <span><a-icon type="close-circle" /></span>
            </section>
          </div>
          <div class="line-box" v-show="idx == 0">
            <div class="line"></div>
            <div class="line-img" @click="addExamine(index)">
              <img src="@/assets/img/Icon/添加-填充-蓝.png" alt="" />
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>
 
<script>
export default {
  props: ["list"],
  data() {
    return {};
  },
  methods: {
    addExamine(idx) {
      this.$emit("addExamineFun", idx);
    },
  },
};
</script>
 
<style lang = "less" scoped>
.approve {
  height: 100%;
  .initial-info-box {
    display: flex;
    flex-direction: column;
    width: 12.5rem;
    .initial-name-box {
      border: 1px solid #6d6b6b;
    }
    header {
      padding: 0.3125rem 0.625rem;
      background: #2c354b;
      color: #ffffff;
    }
    section {
      padding: 0 0.625rem;
      display: flex;
      justify-content: space-between;
      align-items: center;
      height: 3.125rem;
      span:nth-child(2) {
        cursor: pointer;
      }
    }
  }
  .info-box {
    display: flex;
    flex-direction: column;

    .name-box {
      display: flex;
      .name-list-box {
        margin-right: 0.625rem;
        width: 12.5rem;
        .box {
          border: 1px solid #6d6b6b;
        }
      }
      header {
        padding: 0.3125rem 0.625rem;
        background: #2c354b;
        color: #ffffff;
      }
      section {
        padding: 0 0.625rem;
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 3.125rem;
      }
    }
  }
  .line-box {
    display: flex;
    justify-content: center;
    text-align: center;
    position: relative;
    .line {
      height: 4.375rem;
      width: 0.125rem;
      background: #a5a3a3;
    }
    .line-img {
      position: absolute;
      cursor: pointer;
      z-index: 50;
      top: 10%;
      height: 2.5rem;
      width: 2.5rem;
      img {
        height: 100%;
        width: 100%;
      }
    }
  }
}
</style>